package com.rabbitmq.comsumer.listener;

import com.rabbitmq.client.Channel;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.listener.api.ChannelAwareMessageListener;

import java.nio.charset.Charset;

/**
 * @作者: 林江
 * @创建时间: 2023/11/29
 * @功能: 自定义消息监听器
 */
public class CustomRabbitmqComsumerListener implements ChannelAwareMessageListener {

    @Override
    public void onMessage(Message message, Channel channel) throws Exception {
        System.out.println(new String(message.getBody(), Charset.defaultCharset()));
    }
}
